﻿using System;
using System.Diagnostics.Contracts;
using Epi.Data;

namespace CDC.SampleShell.Infrastructure
{
    public abstract class DatabaseUpgraderBase : IDatabaseUpgrader
    {
        protected int _version = -1;
        protected readonly IDbDriver _database;

        public DatabaseUpgraderBase(IDbDriver database)
        {
            // pre
            Contract.Requires(database != null);

            // post
            Contract.Ensures(_database != null);

            _database = database;
        }

        public abstract int GetDatabaseVersion();
        public abstract bool UpgradeDatabase();
    }
}
